import React, { useState, useEffect } from 'react';
import FancyInput from './FancyInput';

const appRef = React.createRef();
class App extends React.Component {
  render() {
    return (
      <div>
        <button
          onClick={() => {
            console.log(appRef.current.setbgc('pink'));
          }}
        >
          按钮修改输入框的背景色
        </button>
        <FancyInput ref={appRef}></FancyInput>
        <button
          onClick={() => {
            appRef.current.setbgc('transparent');
          }}
        >
          恢复背景色
        </button>
        <br />
        <br />
        <br />
        <label htmlFor="xx" htmlFor="xxxx" className="xxx">
          点击按钮获得光标
        </label>
        <input type="text" id="xxxx"></input>
      </div>
    );
  }
}

export default App;
